/// <reference path="./BaseOral.ts" />
namespace wmedu {
    /** 四则运算：先除再减（无括号） */
    export class FourOper_DS extends BaseOral implements IOralCreater {
        create(opt: IOralOpt) {
            let paramArea = opt.paramArea;
            let ops: Enum_OralOp[] = [Enum_OralOp.Div, Enum_OralOp.Sub];
            let first = new FourOper_Div();
            let fres = first.create({ blankSide: opt.blankSide, blankStr: opt.blankStr, paramArea: opt.mdParamArea })
            // 再随机减数
            let p2 = MathUtil.randomInt(fres.value, 1);
            let value = fres.value - p2;

            let nums: number[] = fres.nums.concat([p2]);
            let str = BuildUtil.getOralStr(opt.blankSide, opt.blankStr, nums, ops, value);
            let res: IOralSide = { nums: nums, ops: ops, value: value, str }
            return res;
        }
    }
}